package com.example.page.ui.quotes.viewModel

import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import androidx.paging.PagingData
import androidx.paging.cachedIn
import com.example.page.Graph
import com.example.page.data.model.Quotes
import com.example.page.data.repository.QuotesRepository
import kotlinx.coroutines.flow.Flow

class QuotesViewModel(
    quotesRepository: QuotesRepository = Graph.repository
) : ViewModel() {

    val quotes: Flow<PagingData<Quotes>> = quotesRepository
        .getQuotes()
        .cachedIn(viewModelScope)

}